'\" t
.TH "SD_BUS_SET_METHOD_CALL_TIMEOUT" "3" "" "systemd 257" "sd_bus_set_method_call_timeout"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
sd_bus_set_method_call_timeout, sd_bus_get_method_call_timeout \- Set or query the default D\-Bus method call timeout of a bus object
.SH "SYNOPSIS"
.sp
.ft B
.nf
#include <systemd/sd\-bus\&.h>
.fi
.ft
.HP \w'int\ sd_bus_set_method_call_timeout('u
.BI "int sd_bus_set_method_call_timeout(sd_bus\ *" "bus" ", uint64_t\ " "usec" ");"
.HP \w'int\ sd_bus_get_method_call_timeout('u
.BI "int sd_bus_get_method_call_timeout(sd_bus\ *" "bus" ", uint64_t\ *" "ret" ");"
.SH "DESCRIPTION"
.PP
\fBsd_bus_set_method_call_timeout()\fR
sets the default D\-Bus method call timeout of
\fIbus\fR
to
\fIusec\fR
microseconds\&.
.PP
\fBsd_bus_get_method_call_timeout()\fR
queries the default D\-Bus method call timeout of
\fIbus\fR\&. If no method call timeout was set using
\fBsd_bus_set_method_call_timeout()\fR, the timeout is read from the
\fI$SYSTEMD_BUS_TIMEOUT\fR
environment variable\&. If this environment variable is unset or does not contain a valid timeout, the implementation falls back to a predefined method call timeout of 25 seconds\&. Note that
\fI$SYSTEMD_BUS_TIMEOUT\fR
is read once and cached so callers should not rely on being able to change the default method call timeout at runtime by changing the value of
\fI$SYSTEMD_BUS_TIMEOUT\fR\&. Instead, call
\fBsd_bus_set_method_call_timeout()\fR
to change the default method call timeout\&.
.SH "RETURN VALUE"
.PP
On success, these functions return a non\-negative integer\&. On failure, they return a negative errno\-style error code\&.
.SS "Errors"
.PP
Returned errors may indicate the following problems:
.PP
\fB\-EINVAL\fR
.RS 4
The parameters
\fIbus\fR
or
\fIret\fR
are
\fBNULL\fR\&.
.sp
Added in version 246\&.
.RE
.PP
\fB\-ENOPKG\fR
.RS 4
Bus object
\fIbus\fR
could not be resolved\&.
.sp
Added in version 246\&.
.RE
.SH "NOTES"
.PP
Functions described here are available as a shared library, which can be compiled against and linked to with the
\fBlibsystemd\fR\ \&\fBpkg-config\fR(1)
file\&.
.PP
The code described here uses
\fBgetenv\fR(3), which is declared to be not multi\-thread\-safe\&. This means that the code calling the functions described here must not call
\fBsetenv\fR(3)
from a parallel thread\&. It is recommended to only do calls to
\fBsetenv()\fR
from an early phase of the program when no other threads have been started\&.
.SH "HISTORY"
.PP
\fBsd_bus_set_method_call_timeout()\fR
and
\fBsd_bus_get_method_call_timeout()\fR
were added in version 246\&.
.SH "SEE ALSO"
.PP
\fBsystemd\fR(1), \fBsd-bus\fR(3), \fBsd_bus_call\fR(3)
